var rootPath=null;

$(document).ready(function(){  
	rootPath=getRootPath();   
	schoolOption();
	$("#wxpay").click(function(){
		var studentid = window.sessionStorage.getItem("id");
		window.location.href=rootPath+"/userAuth";
	});
});  
	// $("#select_id").append("<option value='Value'>Text</option>"); 



 function schoolOption(){
	var iidd = window.sessionStorage.getItem("id");
	var school="";
	var major="";
	var direction="";
	var price="";
	var cardid="";
	var ksid="";
	var name="";
	 $.ajax({
		    url : rootPath+"/getStudentById",
		    type : "get",
		    dataType : "json",
		    data : {
		    	Id:iidd
		    },
		    cache : false,
		    async : false,
		    success : function(requestJson) {
		    	var requestStudentArray=requestJson.extend.student;
		    	 school=requestStudentArray.school;
		    	 major=requestStudentArray.major;
		    	 direction=requestStudentArray.direction;
		    	 price=requestStudentArray.price;

		    	 // name=requestStudentArray.name;
		    	 // cardid=requestStudentArray.cardId;
		    	 // ksid=requestStudentArray.examineeId;
		    	}
		});
 
	//alert(school+".."+major+".."+direction+".."+price);
	if(direction!=""&&direction!=null){
		document.getElementById("zyfx").style.display="block "; 
		document.getElementById("school").innerHTML=school;
	 	document.getElementById("fushi").innerHTML=major;
	 	document.getElementById("zhuanyefangxaing").innerHTML=direction;
	 	document.getElementById("jine").innerHTML=price/100;
	 	// document.getElementById("name").innerHTML=name;
	 	// document.getElementById("ksid").innerHTML=ksid;
	 	// document.getElementById("cardid").innerHTML=cardid;
	}else{
		document.getElementById("school").innerHTML=school;
	 	document.getElementById("fushi").innerHTML=major;
	 	document.getElementById("jine").innerHTML=price/100;
	 	// document.getElementById("name").innerHTML=name;
	 	// document.getElementById("ksid").innerHTML=ksid;
	 	// document.getElementById("cardid").innerHTML=cardid;
	}
 

	 // $.ajax({
		//     url : rootPath+"/getSchoolMajor",
		//     type : "get",
		//     dataType : "json",
		//     cache : false,
		//     async : false,
		//     success : function(requestJson) {
		    	
		//     	var json = eval(requestJson);
		//     	if (json.code > 0) {
		//     		var requestStudentArray=requestJson.extend.pageInfo.list;
		//     		 if (requestStudentArray.length != 0) {
		//     		 	var obj=document.getElementById('school');
		//                 for (var i = 0; i < requestStudentArray.length; i++) {
		//                     //alert(requestStudentArray[i]["school"]);
		//                     obj.options.add(new Option(requestStudentArray[i]["school"],requestStudentArray[i]["school"])); //这个兼容IE与firefox 
  //               		}
		//     		}
		//     }
		// }
		// });

 }
function loginButtonClick(){
	document.getElementById('sub').disabled = true;
    document.getElementById('sub').value="跳转中...";
	window.location.href=rootPath+"/userAuth";
}